#include "hal_uart.h"

void hal_uart_init(uint8_t port, uint32_t baudrate)
{
    switch(port)
    {
        case COM1:
            uart1_init(baudrate);
            return;
        case COM2:
            uart2_init(baudrate);
            return;
        default:
            return;
    }
}

uint16_t hal_uart_write(uint8_t port, uint8_t *pdata, uint16_t len)
{
	uint16_t l;
	switch(port)
	{
		case COM1:
			l = uart1_write_data(pdata, len);
			break;
		case COM2:
			l = uart2_write_data(pdata, len);
			break;
		default:
			l = 0;
			break;
	}
	return l;
}

